<?php require('connections/con_gl.php'); ?>
<?php
cekAkses($_SESSION[akses],"MS-8-2");
mysql_select_db($database_con_gl, $con_gl);
$query_klas = "SELECT id, jeniskendaraan FROM gl_jeniskendaraan ORDER BY jeniskendaraan ASC";
$klas = mysql_query($query_klas, $con_gl) or die(mysql_error());
$row_klas = mysql_fetch_assoc($klas);
$totalRows_klas = mysql_num_rows($klas);

mysql_select_db($database_con_gl, $con_gl);
$query_klas1 = "SELECT id, merk FROM gl_merkkendaraan ORDER BY merk ASC";
$klas1 = mysql_query($query_klas1, $con_gl) or die(mysql_error());
$row_klas1 = mysql_fetch_assoc($klas1);
$totalRows_klas1 = mysql_num_rows($klas1);

mysql_select_db($database_con_gl, $con_gl);
$query_klas2 = "SELECT id, tipekendaraan FROM gl_tipekendaraan ORDER BY tipekendaraan ASC";
$klas2 = mysql_query($query_klas2, $con_gl) or die(mysql_error());
$row_klas2 = mysql_fetch_assoc($klas2);
$totalRows_klas2 = mysql_num_rows($klas2);

mysql_select_db($database_con_gl, $con_gl);
$query_klas3 = "SELECT id, area FROM gl_area ORDER BY area ASC";
$klas3 = mysql_query($query_klas3, $con_gl) or die(mysql_error());
$row_klas3 = mysql_fetch_assoc($klas3);
$totalRows_klas3 = mysql_num_rows($klas3);

mysql_select_db($database_con_gl, $con_gl);
$query_klas5 = "SELECT id, status FROM gl_statuskendaraan ORDER BY status ASC";
$klas5 = mysql_query($query_klas5, $con_gl) or die(mysql_error());
$row_klas5 = mysql_fetch_assoc($klas5);
$totalRows_klas5 = mysql_num_rows($klas5);

mysql_select_db($database_con_gl, $con_gl);
$query_klas6 = "SELECT id, jenis FROM gl_jenisasuransi ORDER BY jenis ASC";
$klas6 = mysql_query($query_klas6, $con_gl) or die(mysql_error());
$row_klas6 = mysql_fetch_assoc($klas6);
$totalRows_klas6 = mysql_num_rows($klas6);

mysql_select_db($database_con_gl, $con_gl);
$query_klas7 = "SELECT id, nama FROM gl_kontak WHERE type='Asuransi' ORDER BY nama ASC";
$klas7 = mysql_query($query_klas7, $con_gl) or die(mysql_error());
$row_klas7 = mysql_fetch_assoc($klas7);
$totalRows_klas7 = mysql_num_rows($klas7);

mysql_select_db($database_con_gl, $con_gl);
$query_klas8 = "select * from gl_kontak WHERE type='Karyawan' AND tkaryawan='Driver' order by nama";
$klas8 = mysql_query($query_klas8, $con_gl) or die(mysql_error());
$row_klas8 = mysql_fetch_assoc($klas8);
$totalRows_klas8 = mysql_num_rows($klas8);

mysql_select_db($database_con_gl, $con_gl);
$query_klas9 = "SELECT id, nama FROM gl_kontak WHERE type='Customer' ORDER BY nama ASC";
$klas9 = mysql_query($query_klas9, $con_gl) or die(mysql_error());
$row_klas9 = mysql_fetch_assoc($klas9);
$totalRows_klas9 = mysql_num_rows($klas9);

mysql_select_db($database_con_gl, $con_gl);
$query_klas10 = "SELECT id, jenisbbm FROM gl_jenisbbm ORDER BY jenisbbm ASC";
$klas10 = mysql_query($query_klas10, $con_gl) or die(mysql_error());
$row_klas10 = mysql_fetch_assoc($klas10);
$totalRows_klas10 = mysql_num_rows($klas10);


$colname_edit = "-1";
if (isset($_GET['id'])) {
  $colname_edit = (get_magic_quotes_gpc()) ? $_GET['id'] : addslashes($_GET['id']);
}
mysql_select_db($database_con_gl, $con_gl);
$query_edit = sprintf("SELECT * FROM gl_masterkendaraan WHERE id = %s", $colname_edit);
$edit = mysql_query($query_edit, $con_gl) or die(mysql_error());
$row_edit = mysql_fetch_assoc($edit);
$totalRows_edit = mysql_num_rows($edit);

mysql_select_db($database_con_gl, $con_gl);
$query_klas4 = "SELECT id, gudang FROM gl_gudang where area='$row_edit[area]' ORDER BY gudang ASC";
$klas4 = mysql_query($query_klas4, $con_gl) or die(mysql_error());
$row_klas4 = mysql_fetch_assoc($klas4);
$totalRows_klas4 = mysql_num_rows($klas4);
?>
<link href="ccss/ui.datepicker.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="js/ui.datepicker.js"></script>
<script type="text/javascript">
<!--
$(function()
      {
        $('.calendar').datepicker({
            appendText : "",
            dateFormat : 'yy/mm/dd'
          });
      });
	  
</script>
<script type="text/javascript" src="js/ajax_data.js"></script>
<script type="text/javascript">
$(document).ready(function() {

	$().ajaxStart(function() {
		$('#loading').show();
		$('#result').hide();
	}).ajaxStop(function() {
		$('#loading').hide();
		$('#result').fadeIn('slow');
	});

	$('#edit').submit(function() {
		$.ajax({
			type: 'POST',
			url: $(this).attr('action'),
			data: $(this).serialize(),
			success: function(data) {
				$('#result').html(data);
			}
		})
		return false;
	});
  $('#result').click(function(){
  $(this).hide();
  });
})
</script>
<div id="loading" style="display:none;"><img src="images/loading.gif" alt="loading..." /></div>
<div id="result" style="display:none;"></div>
<h1>Edit Data Stok Kendaraan</h1>
<form action="proses/masterkendaraan.php?act=edit" method="POST" name="edit" id="edit" >
  <table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
    <tr>
      <td colspan="2" align="right" bgcolor="#DDDDDD"><div align="left">Data Umum Kendaraan</div></td>
      <td width="1%" bgcolor="#FFFFFF">&nbsp;</td>
      <td colspan="2" bgcolor="#DDDDDD">Data Surat-Surat Kendaraan</td>
      <td width="1%" bgcolor="#FFFFFF">&nbsp;</td>
      <td colspan="2" bgcolor="#DDDDDD">Data Operasional </td>
    </tr>
    <tr>
      <td width="13%" align="right" valign="top" bgcolor="#FFFFFF">Kode Asset </td>
      <td bgcolor="#FFFFFF"><input name="kodeasset" type="text" id="kodeasset" value="<?php echo $row_edit['kodeasset']; ?>" size="30" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td width="13%" bgcolor="#EEEEEE"><div align="left">STNK </div></td>
      <td width="20%" bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td width="13%" bgcolor="#FFFFFF"><div align="right">Nama Pengemudi : </div></td>
      <td width="20%" bgcolor="#FFFFFF"><select name="namapengemudi" id="namapengemudi" style="width:180px;">
          <option value="">Pilih Nama Pengemudi</option>
          <?php if($totalRows_klas8 > 0) { do { ?>
          <option value="<?php echo $row_klas8['id'];?>" <?php if($row_klas8['id']==$row_edit['namapengemudi']) { ?>selected="selected"<?php } ?>><?php echo $row_klas8['nama'];?></option>
          <?php }while($row_klas8 = mysql_fetch_assoc($klas8)); } ?>
      </select></td>
    </tr>
    <tr>
      <td width="13%" align="right" valign="top" bgcolor="#FFFFFF">No.Polisi*  : </td>
      <td bgcolor="#FFFFFF"><input name="nopolisi" type="text" id="nopolisi" value="<?php echo $row_edit['nopolisi']; ?>" size="30" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF"><div align="right">Atas Nama : </div></td>
      <td bgcolor="#FFFFFF"><input name="namapemilik" type="text" id="namapemilik" value="<?php echo $row_edit['namapemilik']; ?>" size="30" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF"><div align="right">Nama Pelanggan : </div></td>
      <td bgcolor="#FFFFFF"><select name="namacustomer" id="namacustomer" style="width:180px;">
          <option value="">Pilih Nama Pelanggan </option>
          <?php if($totalRows_klas9 > 0) { do { ?>
          <option value="<?php echo $row_klas9['id'];?>" <?php if($row_klas9['id']==$row_edit['namacustomer']) { ?>selected="selected"<?php } ?>><?php echo $row_klas9['nama'];?></option>
          <?php }while($row_klas9 = mysql_fetch_assoc($klas9)); } ?>
      </select></td>
    </tr>
    <tr>
      <td align="right" valign="top" bgcolor="#FFFFFF">Jenis Kendaraan : </td>
      <td bgcolor="#FFFFFF"><select name="jeniskendaraan" id="jeniskendaraan" style="width:180px;">
          <?php
do {  
?>
          <option value="<?php echo $row_klas['id']?>"<?php if (!(strcmp($row_klas['id'], $row_edit['jeniskendaraan']))) {echo "selected=\"selected\"";} ?>><?php echo $row_klas['jeniskendaraan']?></option>
          <?php
} while ($row_klas = mysql_fetch_assoc($klas));
  $rows = mysql_num_rows($klas);
  if($rows > 0) {
      mysql_data_seek($klas, 0);
	  $row_klas = mysql_fetch_assoc($klas);
  }
?>
      </select></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF"><div align="right">No. STNK* : </div></td>
      <td bgcolor="#FFFFFF"><input name="nostnk" type="text" id="nostnk" value="<?php echo $row_edit['nostnk']; ?>" size="30" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF"><div align="right">Jatuh Tempo Sewa :</div></td>
      <td bgcolor="#FFFFFF"><input name="jthtemposewa" type="text" class="calendar" id="jthtemposewa" value="<?php echo $row_edit['jthtemposewa']; ?>" size="15" maxlength="15"/></td>
    </tr>
    <tr>
      <td align="right" valign="top" bgcolor="#FFFFFF">Merk Kendarran : </td>
      <td bgcolor="#FFFFFF"><select name="merk" id="merk" style="width:180px;">
          <?php
do {  
?>
          <option value="<?php echo $row_klas1['id']?>"<?php if (!(strcmp($row_klas1['id'], $row_edit['merk']))) {echo "selected=\"selected\"";} ?>><?php echo $row_klas1['merk']?></option>
          <?php
} while ($row_klas1 = mysql_fetch_assoc($klas1));
  $rows = mysql_num_rows($klas1);
  if($rows > 0) {
      mysql_data_seek($klas1, 0);
	  $row_klas1 = mysql_fetch_assoc($klas1);
  }
?>
      </select></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF"><div align="right">Jatuh Tempo STNK* : </div></td>
      <td bgcolor="#FFFFFF"><input name="jthtempostnk" type="text" class="calendar" id="jthtempostnk" value="<?php echo $row_edit['jthtempostnk']; ?>" size="15" maxlength="15"/></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF"><div align="right">KM Awal  : </div></td>
      <td bgcolor="#FFFFFF"><input name="kmawal" type="text" id="kmawal" value="<?php echo $row_edit['kmawal']; ?>" size="6" maxlength="100" />
        KM Akhir :
        <input name="kmakhir" type="text" id="kmakhir" value="<?php echo $row_edit['kmakhir']; ?>" size="6" maxlength="100" /></td>
    </tr>
    <tr>
      <td align="right" valign="top" bgcolor="#FFFFFF">Tipe Kendaraan : </td>
      <td bgcolor="#FFFFFF"><select name="tipekendaraan" id="tipekendaraan" style="width:180px;">
          <?php
do {  
?>
          <option value="<?php echo $row_klas2['id']?>"<?php if (!(strcmp($row_klas2['id'], $row_edit['tipekendaraan']))) {echo "selected=\"selected\"";} ?>><?php echo $row_klas2['tipekendaraan']?></option>
          <?php
} while ($row_klas2 = mysql_fetch_assoc($klas2));
  $rows = mysql_num_rows($klas2);
  if($rows > 0) {
      mysql_data_seek($klas2, 0);
	  $row_klas2 = mysql_fetch_assoc($klas2);
  }
?>
      </select></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF"><div align="right">No BPKB* : </div></td>
      <td bgcolor="#FFFFFF"><input name="nobpkb" type="text" id="nobpkb" value="<?php echo $row_edit['nobpkb']; ?>" size="30" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td colspan="2" bgcolor="#DDDDDD">Kelengkapan Kendaraan</td>
    </tr>
    <tr>
      <td align="right" valign="top" bgcolor="#FFFFFF">Tahun Pembuatan : </td>
      <td bgcolor="#FFFFFF"><input name="tahun" type="text" id="tahun" value="<?php echo $row_edit['tahun']; ?>" size="30" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF"><div align="right">No. Mesin* : </div></td>
      <td bgcolor="#FFFFFF"><input name="nomesin" type="text" id="nomesin" value="<?php echo $row_edit['nomesin']; ?>" size="30" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF"><input name="ban" type="checkbox" id="ban" value="ok" <?php if(strstr($row_edit['ban'],"ok")) { ?>checked="checked"<?php } ?>/>
        Ban Cadangan </td>
      <td valign="top" bgcolor="#FFFFFF"><input name="radiotape" type="checkbox" id="radiotape" value="ok" <?php if(strstr($row_edit['radiotape'],"ok")) { ?>checked="checked"<?php } ?>/>
        Radio Tape </td>
    </tr>
    <tr>
      <td align="right" valign="top" bgcolor="#FFFFFF">Warna Utama : </td>
      <td bgcolor="#FFFFFF"><input name="warnautama" type="text" id="warnautama" value="<?php echo $row_edit['warnautama']; ?>" size="30" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF"><div align="right">No. Rangka* : </div></td>
      <td bgcolor="#FFFFFF"><input name="norangka" type="text" id="norangka" value="<?php echo $row_edit['norangka']; ?>" size="30" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF"><input name="dongkrak" type="checkbox" id="dongkrak" value="ok" <?php if(strstr($row_edit['dongkrak'],"ok")) { ?>checked="checked"<?php } ?>/>
        Dongkrak</td>
      <td valign="top" bgcolor="#FFFFFF"><input name="karpet" type="checkbox" id="karpet" value="ok" <?php if(strstr($row_edit['karpet'],"ok")) { ?>checked="checked"<?php } ?>/>
        Karpet Lantai </td>
    </tr>
    <tr>
      <td align="right" valign="top" bgcolor="#FFFFFF">Warna Kombinasi : </td>
      <td bgcolor="#FFFFFF"><input name="warnakomb" type="text" id="warnakomb" value="<?php echo $row_edit['warnakomb']; ?>" size="30" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#EEEEEE">Asuransi Kendaraan </td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF"><input name="segitiga" type="checkbox" id="segitiga" value="ok" <?php if(strstr($row_edit['segitiga'],"ok")) { ?>checked="checked"<?php } ?>/>
        Segitiga Pengaman </td>
      <td valign="top" bgcolor="#FFFFFF"><input name="doproda" type="checkbox" id="doproda" value="ok" <?php if(strstr($row_edit['doproda'],"ok")) { ?>checked="checked"<?php } ?>/>
        Dop Roda </td>
    </tr>
    <tr>
      <td align="right" valign="top" bgcolor="#FFFFFF">Jenis BBM : </td>
      <td bgcolor="#FFFFFF"><select name="jenisbbm" id="jenisbbm" style="width:180px;">
          <?php
do {  
?>
          <option value="<?php echo $row_klas10['id']?>"<?php if (!(strcmp($row_klas10['id'], $row_edit['jenisbbm']))) {echo "selected=\"selected\"";} ?>><?php echo $row_klas10['jenisbbm']?></option>
          <?php
} while ($row_klas10 = mysql_fetch_assoc($klas10));
  $rows = mysql_num_rows($klas10);
  if($rows > 0) {
      mysql_data_seek($klas10, 0);
	  $row_klas10 = mysql_fetch_assoc($klas10);
  }
?>
      </select></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF"><div align="right">Status Asuransi : </div></td>
      <td bgcolor="#FFFFFF"><select name="statusasuransi" id="statusasuransi" onchange="checkstatusasuransi(this.value);" style="width:180px;">
        <option value="NONE" selected="selected" <?php if (!(strcmp("NONE", $row_edit['statusasuransi']))) {echo "selected=\"selected\"";} ?>>NONE</option>
        <option value="ADA" <?php if (!(strcmp("ADA", $row_edit['statusasuransi']))) {echo "selected=\"selected\"";} ?>>ADA</option>
      </select></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF"><input name="kunciroda" type="checkbox" id="kunciroda" value="ok" <?php if(strstr($row_edit['kunciroda'],"ok")) { ?>checked="checked"<?php } ?>/>
        Kunci Roda </td>
      <td valign="top" bgcolor="#FFFFFF"><input name="pematikapi" type="checkbox" id="pematikapi" value="ok" <?php if(strstr($row_edit['pematikapi'],"ok")) { ?>checked="checked"<?php } ?>/>
        Pematik Api </td>
    </tr>
    <tr>
      <td align="right" valign="top" bgcolor="#FFFFFF">Est. Rasio BBM : </td>
      <td bgcolor="#FFFFFF"><input name="rasio" type="text" id="rasio" value="<?php echo $row_edit['rasio']; ?>" size="10" maxlength="100" />
        KM/Liter</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF"><div align="right">Jens Polis : </div></td>
      <td bgcolor="#FFFFFF"><select name="select" id="select" style="width:180px;">
        <option value="">Pilih Jenis Polis </option>
        <?php if($totalRows_klas6 > 0) { do { ?>
        <option value="<?php echo $row_klas6['id'];?>" <?php if($row_klas6['id']==$row_edit['jenisasuransi']) { ?>selected="selected"<?php } ?>><?php echo $row_klas6['jenis'];?></option>
        <?php }while($row_klas6 = mysql_fetch_assoc($klas6)); } ?>
      </select></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr>
      <td align="right" valign="top" bgcolor="#FFFFFF">Jumlah seat : </td>
      <td bgcolor="#FFFFFF"><input name="jmlseat" type="text" id="jmlseat" value="<?php echo $row_edit['jmlseat']; ?>" size="10" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF"><div align="right">Perusahaan Asuransi : </div></td>
      <td bgcolor="#FFFFFF"><select name="namaperusahaan" id="namaperusahaan" style="width:180px;">
        <option value="">Pilih Nama Perusahaan</option>
        <?php if($totalRows_klas7 > 0) { do { ?>
        <option value="<?php echo $row_klas7['id'];?>" <?php if($row_klas7['id']==$row_edit['namaperusahaan']) { ?>selected="selected"<?php } ?>><?php echo $row_klas7['nama'];?></option>
        <?php }while($row_klas7 = mysql_fetch_assoc($klas7)); } ?>
      </select></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td colspan="2" bgcolor="#DDDDDD">Status Kendaraan</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF"><div align="right">No.Polis : </div></td>
      <td bgcolor="#FFFFFF"><input name="nopolis" type="text" id="nopolis" value="<?php echo $row_edit['nopolis']; ?>" size="30" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr>
      <td width="13%" bgcolor="#FFFFFF"><div align="right">Area : </div></td>
      <td width="19%" bgcolor="#FFFFFF"><select name="area" id="area" onchange="getListCabang();" style="width:180px;">
          <?php
do {  
?>
          <option value="<?php echo $row_klas3['id']?>"<?php if (!(strcmp($row_klas3['id'], $row_edit['area']))) {echo "selected=\"selected\"";} ?>><?php echo $row_klas3['area']?></option>
          <?php
} while ($row_klas3 = mysql_fetch_assoc($klas3));
  $rows = mysql_num_rows($klas3);
  if($rows > 0) {
      mysql_data_seek($klas3, 0);
	  $row_klas3 = mysql_fetch_assoc($klas3);
  }
?>
      </select></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF"><div align="right">Jatuh Tempo Polis : </div></td>
      <td bgcolor="#FFFFFF"><input name="jthtempopolis" type="text" class="calendar" id="jthtempopolis" value="<?php echo $row_edit['jthtempopolis']; ?>" size="15" maxlength="15"/></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr>
      <td bgcolor="#FFFFFF"><div align="right">Cabang : </div></td>
      <td bgcolor="#FFFFFF"><label id="divListCabang">
        <select name="cabang" id="cabang" style="width:180px;">
          <?php
do {  
?>
          <option value="<?php echo $row_klas4['id']?>"<?php if (!(strcmp($row_klas4['id'], $row_edit['cabang']))) {echo "selected=\"selected\"";} ?>><?php echo $row_klas4['gudang']?></option>
          <?php
} while ($row_klas4 = mysql_fetch_assoc($klas4));
  $rows = mysql_num_rows($klas4);
  if($rows > 0) {
      mysql_data_seek($klas4, 0);
	  $row_klas4 = mysql_fetch_assoc($klas4);
  }
?>
        </select>
      </label></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#EEEEEE">KIR</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr>
      <td bgcolor="#FFFFFF"><div align="right">Status Kendaraan : </div></td>
      <td bgcolor="#FFFFFF"><select name="status" id="status" style="width:180px;">
          <?php
do {  
?>
          <option value="<?php echo $row_klas5['id']?>"<?php if (!(strcmp($row_klas5['id'], $row_edit['status']))) {echo "selected=\"selected\"";} ?>><?php echo $row_klas5['status']?></option>
          <?php
} while ($row_klas5 = mysql_fetch_assoc($klas5));
  $rows = mysql_num_rows($klas5);
  if($rows > 0) {
      mysql_data_seek($klas5, 0);
	  $row_klas5 = mysql_fetch_assoc($klas5);
  }
?>
      </select></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF"><div align="right">Status KIR: </div></td>
      <td bgcolor="#FFFFFF"><select name="statuskir" id="statuskir" onchange="checkstatuskir(this.value);" style="width:180px;">
        <option value="NONE" selected="selected" <?php if (!(strcmp("NONE", $row_edit['statuskir']))) {echo "selected=\"selected\"";} ?>>NONE</option>
        <option value="ADA" <?php if (!(strcmp("ADA", $row_edit['statuskir']))) {echo "selected=\"selected\"";} ?>>ADA</option>
      </select></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr>
      <td><div align="right">Tersedia : </div></td>
      <td><input <?php if (!(strcmp($row_edit['tersedia'],1))) {echo "checked=\"checked\"";} ?> name="ada" type="checkbox" id="ada" value="1" />
          <small>Check jika tersedia</small> </td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF"><div align="right">No. KIR :</div></td>
      <td bgcolor="#FFFFFF"><input name="nokir" type="text" id="nokir" value="<?php echo $row_edit['nokir']; ?>" size="30" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr>
      <td align="right" valign="top" bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF"><div align="right">Jatuh Tempo KIR: </div></td>
      <td bgcolor="#FFFFFF"><input name="jthtempokir" type="text" class="calendar" id="jthtempokir" value="<?php echo $row_edit['jthtempokir']; ?>" size="15" maxlength="15"/>
      <input name="id" type="hidden" id="id" value="<?php echo $row_edit['id']; ?>" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    
    <tr>
      <td align="left" bgcolor="#FFFFFF"><em>*Harus diisi</em></td>
      <td bgcolor="#FFFFFF"><label>
        <input name="Save" type="submit" id="Save" value="Simpan" />
        </label>
          <label>
          <input type="button" name="Button" value="Batal" onClick="javascript:history.go(-1);">
        </label></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
  </table>
</form>
